/*
 *****************************************************************************
 * Copyright 2004-2012 Aiti Ltd. All rights reserved.
 *****************************************************************************
 *  Change Activity:
 *  --------------------------------------------------------------------------
 *  Date      Author          Description
 *  --------------------------------------------------------------------------
 *  Jan 14, 2013 ThinhNV2  Initial Code drop.
 *****************************************************************************
 */
package com.aiti.core.c1202m.logger.logging;

import java.util.logging.Level;
import java.util.logging.Logger;

import com.aiti.c1202m.core.logger.IfLogger;

/**
 * <H3>LoggingLoggerAdapter</H3>
 *
 * @author ThinhNV2
 * @since Jan 14, 2013
 */
public class LoggingLoggerAdapter implements IfLogger {

	private final Logger logger;	

	//***** Constructor *****
	/**
	 * Constructor.<br>
	 * @param targetClassName - the class name which need to log.
	 */
	public LoggingLoggerAdapter(String targetClassName) {
		logger = Logger.getLogger(targetClassName);
	}

	//***** Public method *****
	/**
	 * info
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#info(java.lang.String)
	 */
	public void info(String message) {
		logger.info(message);
	}

	/**
	 * info
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#info(java.lang.String, java.lang.Throwable)
	 */
	public void info(String message, Throwable t) {
		logger.info(message);
	}

	/**
	 * error
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#error(java.lang.String)
	 */
	public void error(String message) {
		logger.log(Level.SEVERE, message);
	}

	/**
	 * error
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#error(java.lang.String, java.lang.Throwable)
	 */
	public void error(String message, Throwable t) {
		logger.log(Level.SEVERE, message, t);
	}

	/**
	 * debug
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#debug(java.lang.String)
	 */
	public void debug(String message) {
		logger.log(Level.FINEST, message);
	}

	/**
	 * debug
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#debug(java.lang.String, java.lang.Throwable)
	 */
	public void debug(String message, Throwable t) {
		logger.log(Level.FINEST, message, t);
	}
	
	/**
	 * warn
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#warn(java.lang.String)
	 */
	public void warn(String message) {
		logger.log(Level.WARNING, message);
	}
	/**
	 * warn
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#warn(java.lang.String, java.lang.Throwable)
	 */
	public void warn(String message, Throwable t) {
		logger.log(Level.WARNING, message, t);
	}

	/**
	 * isDebugEnabled
	 * @see com.nsk.base.mid.java.common.util.trace.IfLogger#isDebugEnabled()
	 */
	public boolean isDebugEnabled() {
		return logger.isLoggable(Level.FINEST);
	}

	//***** Protected method *****
	//***** Private method *****
	//***** call back methods *****
	//***** getter and Setter *****
}
